select cast(@@servername as varchar(15)) [Server Name] , avg(l1.total_read-l2.total_read) [avg daily reads] , avg(l1.total_write-l2.total_write) [avg daily writes] , cast(avg((l1.total_read-cast(l2.total_read as decimal(12,2)))/((l1.total_write-l2.total_write) + (l1.total_read-l2.total_read))) as numeric(8,8)) [avg % read in 2004] , cast(min((l1.total_read-cast(l2.total_read as decimal(12,2)))/((l1.total_write-l2.total_write) + (l1.total_read-l2.total_read))) as numeric(8,8)) [min % read in 2004] , cast(max((l1.total_read-cast(l2.total_read as decimal(12,2)))/((l1.total_write-l2.total_write) + (l1.total_read-l2.total_read))) as numeric(8,8)) [max % read in 2004] from lnkbdm1.admin.dbo.spt_monitor_log l1 join lnkbdm1.admin.dbo.spt_monitor_log l2 on l1.id = l2.id + 1 where l1.total_read-l2.total_read > 0 and l1.total_write-l2.total_write > 0 and datepart(yyyy,l1.lastrun) = 2004 and datepart(mm,l1.lastrun) = 3 union all select cast(@@servername as varchar(15)) [Server Name] , avg(l1.total_read-l2.total_read) [avg daily reads] , avg(l1.total_write-l2.total_write) [avg daily writes] , cast(avg((l1.total_read-cast(l2.total_read as decimal(12,2)))/((l1.total_write-l2.total_write) + (l1.total_read-l2.total_read))) as numeric(8,8)) [avg % read in 2004] , cast(min((l1.total_read-cast(l2.total_read as decimal(12,2)))/((l1.total_write-l2.total_write) + (l1.total_read-l2.total_read))) as numeric(8,8)) [min % read in 2004] , cast(max((l1.total_read-cast(l2.total_read as decimal(12,2)))/((l1.total_write-l2.total_write) + (l1.total_read-l2.total_read))) as numeric(8,8)) [max % read in 2004] from lnkbdm2.admin.dbo.spt_monitor_log l1 join lnkbdm2.admin.dbo.spt_monitor_log l2 on l1.id = l2.id + 1 where l1.total_read-l2.total_read > 0 and l1.total_write-l2.total_write > 0 and datepart(yyyy,l1.lastrun) = 2004 and datepart(mm,l1.lastrun) = 3